<script>
import { mapMutations } from 'vuex';
import { delParam,delEmptyParam } from 'util/stringUtil.js';
export default {
	onLaunch: function(e) {
		// #ifdef H5
		if (e.query.token) {
			this.login({token:e.query.token,clientUserId:e.query.clientUserId,isAdmin:e.query.isAdmin,canDiscuss:e.query.canDiscuss,miniProgramTitle:e.query.miniProgramTitle});
			var url=window.location.href;
			url=delParam(url,'token');
			url=delParam(url,'clientUserId');
			url=delParam(url,'isAdmin');
			url=delParam(url,'canDiscuss');
			url=delParam(url,'miniProgramTitle');
			if(url.indexOf('?&')>0)
			{
				url=url.replace('?&','?');
			}
			url=delEmptyParam(url);
			 window.location.href = url;
		}
		// #endif

		console.log('App Launch');
		console.table(this.$theme)
	},
	onShow: function() {
		console.log('App Show');
	},
	onHide: function() {
		console.log('App Hide');
	},
	methods: {
		...mapMutations('user', ['login'])
	}
};
</script>

<style lang="scss">
/*每个页面公共css */
@import "uview-ui/index.scss";
</style>
